/**
 * $Revision: 1.0 $
 * $Author: Eric Yang $
 * $Date: Mar 7, 2010 11:31:12 AM $
 *
 * Author: Eric Yang
 * Date  : Mar 7, 2010 11:31:12 AM
 *
 */
package com.gooex.web.action.gbuy.common;

import java.util.Map;

import com.gooex.service.organization.IApplicationSessionContext;
import com.gooex.web.action.BaseAnonymousAction;


/**
 * @author Eric Yang
 * @version 1.0
 */
public class PageBackAction extends BaseAnonymousAction {

	private String linkAddr;

	private String linkText;

	private String url;

	private String msg = "success";

	private boolean start = true;

	public String execute() throws Exception {
		Map<String, String> url = getBackURLs().poll();
		if (url != null) {
			linkAddr = url.get(IApplicationSessionContext._LINK_ADDR);
			linkText = url.get(IApplicationSessionContext._LINK_TEXT);
		} else {
			linkAddr = "";
			linkText = "上一页";
		}
		return SUCCESS;
	}

	public String logURL() throws Exception {
		if (url != null) {
			url = url.replace("_*_", "&");
			if (start)
				getBackURLs().clear();
			setBackURL(url);
		}
		return SUCCESS;
	}

	public String getLinkText() {
		return linkText;
	}

	public String getLinkAddr() {
		return linkAddr;
	}

	public void setStart(boolean start) {
		this.start = start;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getMsg() {
		return msg;
	}

}
